package registration;

import java.io.Serializable;

public class Address implements Serializable {
    private String text;

    public Address(String text) throws jakarta.validation.ValidationException {
        if (null == text) {
            throw new jakarta.validation.ValidationException("地址不能为null");
        } else if (!isValid(text)) {
            throw new jakarta.validation.ValidationException("地址格式无效");
        }
        this.text = text;
    }

    public static boolean isValid(String text){
        return true;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public String toString() {
        return text;
    }
}
